<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript" src="scripts/boot.js"></script>
</head>
<body>
<form id="form1" method="post">
	<input name="id" class="mini-hidden" />
    <div style="padding-left:30px;padding-bottom:15px;padding-top: 10px;">
        <table style="width:100%;" cellspacing="0" cellpadding="10">	
            <tr>
                <td style="width:80px;">药品名称：</td>
                <td style="width:150px;">
					<input id="medicineId" name="id" class="mini-autocomplete" required="true" style="width:180px;" valueField="id" textField="name" url="storage_detail_find_medicine.do" valueFromSelect="true" readonly="readonly"/>
				</td>
            </tr>
            <tr>
                <td style="width:80px;">药品数量：</td>
                <td>
                	<input name="warnNum" class="mini-spinner" minValue="1" maxValue="999" style="width:180px;"/>
                </td>
            </tr>
        </table>
    </div>
    <div style="text-align:center;padding-top:20px;">
        <a class="mini-button" onclick="SaveData();" style="width:60px;">确定</a>       
        <a class="mini-button" onclick="window.CloseOwnerWindow('cancel')" style="width:60px;">取消</a>       
    </div> 
</form>
<script type="text/javascript">
	mini.parse();
	var form = new mini.Form("#form1");
	//保存数据
	function SaveData() {
	    var o = form.getData(true);
	    form.validate();
	    if (form.isValid() == false) return;
	    $.post("medicine_warn_spe_edit.do",o,function(data){
	    	if(data.success){
            	window.CloseOwnerWindow("succ");
            }else{
            	mini.showTips({content:text.message,state:'danger',x:'center',y:'top'});
            }
		},"json");
	}
	
	//标准方法接口定义
    function SetData(data) {
         //跨页面传递的数据对象，克隆后才可以安全使用
         data = mini.clone(data);
         form.setData(data);
         var medicine = mini.get("medicineId");
         medicine.setText(data.name);
    }
</script>
</body>
</html>